<template>
  <div class="home_page">
    <header class="header_home">
      <div class="c-left">
        <img class="logo"
             :src="info.logo"
             :alt="info.title">
        <!-- <div class="qr">
          <img :src="'https://yn.12348.laway.cn' + $root.config.web_qr_url" width="99" height="99" alt="昆明司法行政二维码">
          <div>
            <strong>官方公众号</strong>
            <p>微信关注公众号，使用手机获得服务</p>
          </div>
        </div> -->
      </div>
      <div class="c-right">
        <img src="/static/web/theme/gov_base_terminal/img/home/icon-clock.png"
             alt="时钟">
        <div v-html="time">
        </div>
      </div>
    </header>
    <div class="main">
      <div class="per_block">

        <router-link to="zixun"
                     class="c1-1 colunm_block">
          <img src="/static/web/theme/gov_base_terminal/img/home/logo_jiqiren2.png"
               alt="法律咨询机器人">
          <h2>法律咨询机器人</h2>
          <p>采用人工智能技术进行法律咨询，24小时提供免费法律咨询和服务，自动给出专业详细的法律意见报告、证据清单、起诉状、协议书等</p>
        </router-link>

        <router-link to="zixun/99"
                     class="c1-2 colunm_block">
          <img src="/static/web/theme/gov_base_terminal/img/home/logo_wenshu.png"
               alt="智能法律文书">
          <h2>智能法律文书</h2>
          <p>为您定制专属协议书、起诉状，供您参考使用</p>
        </router-link>
      </div>
      <div class="per_block">
        <!-- <router-link to="/service/yuanzhu" href="/service/yuanzhu" class="c2 colunm_block"> -->
        <router-link to="#"
                     href="/service/yuanzhu"
                     class="c2 colunm_block">
          <img src="/static/web/theme/gov_base_terminal/img/home/logo_falvyuanzhu.png"
               alt="法律援助">
          <h2>法律援助网上服务厅</h2>
          <!-- <p>申请自动预判、在线申请、预约办理法律援助</p> -->
        </router-link>
        <!-- <router-link to="/service/tiaojie" class="c3 colunm_block"> -->
        <router-link to="#"
                     class="c3 colunm_block">
          <img src="/static/web/theme/gov_base_terminal/img/home/logo_tiaojie.png"
               alt="调解纠纷">
          <h2>人民调解</h2>
          <!-- <p>对纠纷矛盾的双方进行调解、劝解</p> -->
        </router-link>
      </div>
      <div class="per_block">
        <div class="row_sm_block">
          <!-- <router-link to="/pufa" class="c5 row_block"> -->
          <router-link to="#"
                       class="c5 row_block">
            <img src="/static/web/theme/gov_base_terminal/img/home/logo_pufa.png"
                 alt="公证服务">
            <h3>普法动态</h3>
          </router-link>
          <!-- <router-link to="/yasf" class="c5 row_block"> -->
          <router-link to="#"
                       class="c5 row_block">
            <!-- <img src="/static/web/theme/gov_base_terminal/img/home/logo_ycts.png" alt="远程探视"> -->
            <img src="/static/web/theme/gov_base_terminal/img/home/logo_yasf.png"
                 alt="以案释法">
            <h3>以案释法</h3>
          </router-link>
        </div>

        <div class="row_sm_block">
          <!-- <router-link to="/service/gongzheng" class="c5 row_block"> -->
          <router-link to="#"
                       class="c5 row_block">
            <img src="/static/web/theme/gov_base_terminal/img/home/logo_gongzheng.png"
                 alt="公证服务">
            <h3>公证服务</h3>
          </router-link>
          <!-- <router-link to="/service/jianding" class="c5 row_block"> -->
          <router-link to="#"
                       class="c5 row_block">
            <img src="/static/web/theme/gov_base_terminal/img/home/logo_jianding.png"
                 alt="司法鉴定">
            <h3>司法鉴定</h3>
          </router-link>
        </div>
        <div class="row_sm_block">
          <!-- <router-link to="/map" class="c6 row_block"> -->
          <router-link to="#"
                       class="c6 row_block">
            <img src="/static/web/theme/gov_base_terminal/img/home/logo_map.png"
                 alt="服务点查询">
            <h3>机构查询</h3>
          </router-link>
          <!-- <router-link to="/lawfirm" class="c6 row_block"> -->
          <router-link to="#"
                       class="c6 row_block">
            <img src="/static/web/theme/gov_base_terminal/img/home/logo_lvshi.png"
                 alt="社区律师查询">
            <h3>律所律师</h3>
          </router-link>
        </div>
        <div class="row_sm_block">
          <router-link to="/law"
                       class="c6 c6-1 row_block">
            <img src="/static/web/theme/gov_base_terminal/img/home/logo_fagui.png"
                 alt="法律法规查询">
            <h3>法律法规查询</h3>
          </router-link>
          <router-link to="/case"
                       class="c6 c6-2 row_block">
            <img src="/static/web/theme/gov_base_terminal/img/home/logo_anli.png"
                 alt="案例库查询">
            <h3>案例库查询</h3>
          </router-link>
        </div>

      </div>
    </div>
    <footer>
      <p>
        <span @click="clearAllCache">技术支持</span>：
        <span @click="showService">律品汇科技（北京）有限公司</span>
      </p>
    </footer>
  </div>
</template>
<script>
import { getLangDate } from '@/functions/common'
export default {
  data () {
    return {
      info: {
        logo: '',
        qrcode: '',
        title: ''
      },
      time: getLangDate()
    }
  },
  mounted () {
    // console.log(this.$root)
    // const get_servicePoit = localStorage.servicePoit
    //   ? JSON.parse(localStorage.servicePoit)
    //   : false
    // if (get_servicePoit && get_servicePoit.extra === 1) {
    //   this.info = {
    //     logo: '/static/web/theme/gov_base_terminal/img/home/logo_pingtai_yn.png',
    //     qrcode: '/static/web/theme/gov_base_terminal/img/home/logo_erweima_yn.jpg'
    //   }
    // }
    const { pc_logo, wechat_qrcode, title } = window.shop_info
    this.info.logo = pc_logo
    this.info.qrcode = wechat_qrcode
    this.info.title = title
    setInterval(() => {
      this.time = getLangDate()
    }, 1000)
  },
  methods: {
    clearAllCache () {
      if (NativeInterface && NativeInterface.clearAllCache) {// eslint-disable-line
        NativeInterface.clearAllCache() // eslint-disable-line
      }
    },
    showService () {
      if (NativeInterface && NativeInterface.showService) {// eslint-disable-line
        NativeInterface.showService() // eslint-disable-line
      }
    }
  }
}
</script>
<style lang="scss">
.home_page {
  height: 100vh;
  background: url('http://xinjiang-yining.lvpin100.com/static/web/theme/gov_xinjiang_xinyuan/img/home/bg.jpg')
    no-repeat;
  padding: 90px 50px 0;
  font-size: 16px;
  .main {
    display: flex;
    .per_block {
      width: 33.33%;
      p {
        padding: 0 35px;
      }
    }
  }
  .header_home {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.7rem;
    .c-left {
      display: flex;
      .logo {
        margin-right: 0.8rem;
        flex-shrink: 0;
        height: 0.85rem;
      }
      .qr {
        display: flex;
        align-items: center;
        color: #fff;
        img {
          margin-right: 0.15rem;
        }
        strong {
          display: block;
          font-size: 0.24rem;
        }
      }
    }
    .c-right {
      display: flex;
      align-items: center;
      color: #fff;
      img {
        margin-right: 0.1rem;
      }
    }
  }

  .per_block {
    padding: 0;
    height: 7.2rem;
    &:first-child {
      margin-left: 0;
    }
    a.colunm_block {
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      text-align: center;
      color: #fff;
      font-size: 0.16rem;
      font-weight: 400;
      &:hover,
      &:active,
      &:link,
      &:visited {
        color: #fff;
        text-decoration: none;
      }
    }
    a.row_block,
    a.row_block_big {
      display: flex;
      flex-direction: row;
      align-items: center;
      color: #fff;
      font-size: 0.16rem;
      font-weight: 400;
    }
    a.row_block {
      padding: 0 0.2rem 0 0.35rem;
    }
    a.row_block_big {
      padding: 0 0.3rem 0 0.75rem;
    }
    .row_sm_block {
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
  }

  .c1 {
    height: 100%;
    background: linear-gradient(135deg, #af392f 10%, #d9473a);
    display: block;
    margin-right: 0.2rem;

    h1 {
      font-size: 0.42rem;
      margin-bottom: 0.4rem;
    }
    p {
      padding: 0 0.5rem;
      margin-bottom: 0.55rem;
    }
  }
  .c1-1 {
    margin: 0 0.2rem 0.2rem 0;
    background: linear-gradient(-45deg, #d9473a, #af392f);
  }
  .c1-2 {
    margin: 0 0.2rem 0 0;
    background: linear-gradient(-45deg, #ffc871, #e29b44);
  }

  .c2 {
    margin-right: 0.2rem; // background: linear-gradient(to bottom right, #3154a9, #5084d5);
    background: linear-gradient(135deg, #3457af, #558ce1);
    margin-bottom: 0.2rem;
    p {
      margin-bottom: 0.28rem;
    }
  }

  .c3 {
    margin-right: 0.2rem; // background: linear-gradient(to bottom right, #70966c, #9bb671);
    background: linear-gradient(135deg, #799f6c, #a9c473);
  }

  .c2,
  .c3,
  .c1-1,
  .c1-2 {
    height: 3.5rem;
    h2 {
      font-size: 0.32rem;
    }
  }

  .c4 {
    height: 1.65rem;
    background: linear-gradient(-45deg, #61b7a7, #2f8675);
    margin-bottom: 0.2rem;
    img {
      margin-right: 0.45rem;
    }
    h2 {
      font-size: 0.32rem;
    }
  }

  .c5 {
    background: linear-gradient(-45deg, #61b7a7, #2f8675);
    flex: 1;
  }

  .c6 {
    background: linear-gradient(-45deg, #95a5a6, #7f8c8d);
  }

  .c5,
  .c6 {
    flex: 1;
    height: 1.65rem;
    margin-bottom: 0.2rem;
    &:first-child {
      margin-right: 0.1rem;
    }
    &:last-child {
      margin-left: 0.1rem;
    }
    img {
      margin-right: 0.25rem;
    }
    h3 {
      font-size: 0.24rem;
    }
  }

  footer p {
    text-align: center;
    font-size: 0.14rem;
    color: #fff;
    margin-top: 0.35rem;
    margin-bottom: 0.45rem;
  }
}

@media screen and (orientation: portrait) {
  .home_page {
    background: url('http://xinjiang-yining.lvpin100.com/static/web/theme/gov_base_terminal/img/home/bg2.jpg')
      no-repeat;
    .header_home {
      margin-bottom: 0.4rem;
      .c-left {
        align-items: center;
        .qr {
          img {
            flex-shrink: 0;
          }
        }
      }
      .c-right {
        display: none;
      }
    }
    .main {
      flex-wrap: wrap;
      .per_block {
        width: 100%;
        display: flex;
        justify-content: space-between;
        height: auto;
        margin-bottom: 0.2rem;
        flex-wrap: wrap;
        .c1-1,
        .c1-2,
        .c2,
        .c3 {
          width: 4.8rem;
          height: 3.2rem;
          margin: 0;
          border-radius: 0.1rem;
        }

        .row_sm_block {
        }
        a.row_block {
          width: 4.8rem;
          border-radius: 0.1rem;
          justify-content: center;
        }
        .c5,
        .c6 {
          h3 {
            font-size: 0.32rem;
            width: 2rem;
          }
          &:first-child {
            margin: 0 0.2rem 0.2rem 0;
          }
          &:last-child {
            margin: 0 0 0.2rem 0;
          }
        }
      }
    }
  }
}
@media screen and (orientation: landscape) {
}

.home_page .c2,
.home_page .c3,
.home_page .c5,
.home_page .c6 {
  background: #95a5a6;
}
.home_page .c6-1 {
  background: linear-gradient(135deg, #3457af, #558ce1);
}
.home_page .c6-2 {
  background: linear-gradient(135deg, #799f6c, #a9c473);
}
</style>
